package com.cn.yang.servlet;

import com.cn.yang.service.MainPageService;
import com.cn.yang.service.impl.MainPageServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/message")
public class MessageServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获得headLink的List。
        MainPageService headLink = new MainPageServiceImpl();
        req.setAttribute("headLink",headLink.selectHeadLink());
        //获得头尾 存储的字段，
        MainPageService headFootService = new MainPageServiceImpl();
        req.setAttribute("headFootService",headFootService.selectHeadFoot());
        //====================================================================================

        
        req.getRequestDispatcher("/jsp/message.jsp").forward(req,resp);
    }
}
